﻿SSVC.Wrap.Dojo.Require(["dijit/_WidgetBase", "dijit/_TemplatedMixin"],
	 SSVC.Wrap.Dojo.Hitch(this,
		function(_WidgetBase, _TemplatedMixin)
		{
			return SSVC.Wrap.Dojo.SetObject("SSVC.UI.TemplateControl", SSVC.Wrap.Dojo.Declare([_WidgetBase, _TemplatedMixin],
                {
                	ElementOnFocus: function(el, innerText)
                	{
                		var startValue = (el.type == "text") ? el.value.trim() : el.innerHTML.trim();

                		if (startValue == innerText)
                		{
                			(el.type == "text") ? el.value = "" : el.innerHTML = "";
                			el.style.color = "#000000";
                		}
                	},

                	ElementOnBlur: function(el, innerText)
                	{
                		var startValue = (el.type == "text") ? el.value.trim() : el.innerHTML.trim();
                		if (startValue == "")
                		{
                			(el.type == "text") ? el.value = innerText : el.innerHTML = innerText;
                			el.style.color = "#758092";
                		}
                	},

                	HideElement: function(el)
                	{
                		el.style.display = "none";
                	},

                	ShowElement: function(el, displayStyle)
                	{
                		if (!displayStyle) displayStyle = "inline"
                		el.style.display = displayStyle;
                	},
                }))
		}));
